/**
 * @desc
 * @author  刘贺[of2220]
 * @company qianmi.com
 * @Date    2017/2/8
 */

'use strict';
import React from 'react';
import Immutable from 'immutable';
import ImgCateTree from './tree';
import OperationBtn from './operationBtn';
import CardList from './cardList';
import {Layout, Menu, Icon} from 'antd';
const {Header, Sider, Content} = Layout;

export default class Container extends React.Component {
    static defaultProps = {
        store : Immutable.fromJS({})
    };

    constructor(props) {
        super(props);
    }

    render() {
        let store = this.props.store;
        let cateTreeData = store.get('cateTreeData'),
            selectNodeId = store.get('selectNodeId'),
            expandedKeys = store.get('expandedKeys'),
            curRelateImgInfoData = store.get('curRelateImgInfoData'),
            pageNum = store.get('pageNum'),
            pageSize = store.get('pageSize'),
            totalCount = store.get('totalCount');
        return (
            <Layout >
                <Sider trigger={null} >
                    <div className="logo"/>
                    <Menu theme="dark" mode="inline" defaultSelectedKeys={['1']}>
                        <Menu.Item key="1">
                            <Icon type="picture"/>
                            <span className="nav-text">图片管理</span>
                        </Menu.Item>
                    </Menu>
                </Sider>

                <Layout>
                    <Content style={{margin: '24px 16px',background:'#fff', padding: 24, minHeight: 280}}>
                        <Layout style={{height:'100%'}}>
                            <Sider style={{background:'#fff',borderRight:'1px solid #dcdcdc'}}>
                                <ImgCateTree cateTreeData={cateTreeData} selectNodeId={selectNodeId} expandedKeys={expandedKeys}/>
                            </Sider>
                            <Content style={{width: '1000px'}}>
                                <Header style={{background:'#fff'}}>
                                    <OperationBtn/>
                                </Header>
                                <Content>
                                    <CardList curRelateImgInfoData={curRelateImgInfoData} pageNum={pageNum} pageSize={pageSize} totalCount={totalCount}/>
                                </Content>
                            </Content>
                        </Layout>
                    </Content>
                </Layout>
            </Layout>
        );
    }
}
